﻿using System;
using System.Data.OleDb;
using Dukey.DBUtility;

public partial class Admin_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session.Clear();
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string userName = txtUserName.Text.Trim();
        string password = txtPassword.Text.Trim();
        
       object o=new BLL.Sys_Admin().IsLoginAdmin(userName,password);
        if(o!=null)
        {
            BaseWeb.instance.AdminId = int.Parse(o.ToString());
            Session["MyCrmUserName"] = userName;           
            Response.Redirect("Main.aspx",true);
        }
        else
        {
            Response.Write("<script>alert('对不起,登录失败!');</script>");
        }

    }
}
